/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.plt.bc;

import edu.upn.sigemfi.plt.be.ContratoRetencion;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Administrador
 */
@Stateless
public class ContratoRetencionFacade implements ContratoRetencionFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(ContratoRetencion contratoRetencion) {
        em.persist(contratoRetencion);
    }

    public void edit(ContratoRetencion contratoRetencion) {
        em.merge(contratoRetencion);
    }

    public void remove(ContratoRetencion contratoRetencion) {
        em.remove(em.merge(contratoRetencion));
    }

    public ContratoRetencion find(Object id) {
        return em.find(ContratoRetencion.class, id);
    }

    public List<ContratoRetencion> findAll() {
        return em.createQuery("select object(o) from ContratoRetencion as o").getResultList();
    }

}
